Skip to content

test: cover Result residual conversion for Exit#201

Open
wenxiaojie1 wants to merge 2 commits into
MusicalNinjaDad:mainfrom
wenxiaojie1:test/result-to-exit-from-residual
Open

test: cover Result residual conversion for Exit#201
wenxiaojie1 wants to merge 2 commits into
MusicalNinjaDad:mainfrom
wenxiaojie1:test/result-to-exit-from-residual

Conversation

@wenxiaojie1

Copy link
Copy Markdown
Contributor

Fixes #176.\n\nAdds a regression test that uses ? on Result<(), String> in a function returning the derived Exit<()>, then verifies the error is converted to Exit::OtherError. The test-local From implementation supplies the residual conversion required by the derive.\n\nValidation:\n- git diff --check\n- Confirmed the test exercises the Result ? path\n\nThe local Windows environment has no Cargo/Rust toolchain, so repository CI is the compilation and test gate.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The blanket impl<T: Termination> From<String> for Exit<T> in the test may prevent adding a more general From implementation for Exit in the main crate later due to coherence rules; consider narrowing the impl (e.g., to a test-only newtype) so it cannot conflict with future library code.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The blanket `impl<T: Termination> From<String> for Exit<T>` in the test may prevent adding a more general `From` implementation for `Exit` in the main crate later due to coherence rules; consider narrowing the impl (e.g., to a test-only newtype) so it cannot conflict with future library code.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@wenxiaojie1

Copy link
Copy Markdown
Contributor Author

Addressed the review: the test conversion is now limited to the actual residual type, Exit<!>, rather than applying to every Exit. This keeps the test focused on the derived Result residual path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration test for Result → Exit behavior via FromResidual and ? operator

1 participant